package top.wshape1.shiziapi.message.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.wshape1.shiziapi.message.domain.MessageBroadcastRead;
import top.wshape1.shiziapi.message.mapper.MessageBroadcastReadMapper;
import top.wshape1.shiziapi.message.service.MessageBroadcastReadService;

import java.util.List;

/**
 * @author Wshape1
 * @description 针对表【t_message_broadcast_read】的数据库操作Service实现
 * @since 2023-09-18 22:09:06
 */
@Service
public class MessageBroadcastReadServiceImpl extends ServiceImpl<MessageBroadcastReadMapper, MessageBroadcastRead>
        implements MessageBroadcastReadService {

    @Override
    public MessageBroadcastRead get(Long msgId, Long userId) {
        return this.getBaseMapper().selectOne(new LambdaQueryWrapper<MessageBroadcastRead>()
                .eq(MessageBroadcastRead::getMsgId, msgId)
                .eq(MessageBroadcastRead::getUserId, userId)
        );
    }

    @Override
    public List<Long> getMsgIdByUserId(Long userId) {
        return this.getBaseMapper().selectMsgIdByUserId(userId);
    }
}




